package com.day18.CallName;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class CallNameDemo {
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new java.io.FileReader("myJava\\CallName.java"));
        ArrayList<String> array = new ArrayList<String>();
        String Line;
        while((Line=br.readLine())!=null){
            array.add(Line);
        }
        br.close();
        Random r=new Random();
        int index=r.nextInt(array.size());
        String name=array.get(index);
        System.out.println("幸运者是："+name);
    }
}
